home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / other / flexcat / lib / c++_catalogf.h < prev    next >
C/C++ Source or Header  |  1999-06-14  |  1KB  |  39 lines

  1. #ifndef CATALOGF_H
  2. #define CATALOGF_H
  3. // Interface file
  4. // MUST be included in your code.
  5. // If you are using FlexCat, you only need to include the header
  6. // file generated by it.
  7. // The locale.library is opened whenever is needed ...
  8.  
  9. #include <exec/types.h>
  10.  
  11. extern struct LocaleBase* LocaleBase;
  12. // data-type that will be used to define the strings from the .cd file ...
  13. // so, you need (if you want hard code) a file with a set of structures
  14. // of this type, containing an identificator ID, and the string itself.
  15. // this way, you could use this class without FlexCat and Locale.library,
  16. // although i do not think WHY should you do that :)
  17. struct CatMessage {
  18.             LONG   ID;
  19.             STRPTR textstring;
  20.           };
  21.  
  22. class CatalogF
  23. {
  24. public:
  25.     CatalogF( const STRPTR   catalogFileName,
  26.           const STRPTR   builtInLanguage ="english", // default
  27.           const LONG     versionNumber =0 ,      // match any
  28.           const STRPTR   languageName =0,         // use user defined
  29.           struct Locale* loc =0 );             // user defined
  30.     const STRPTR GetStr(const CatMessage& mess) const;
  31.     ~CatalogF();
  32. private:
  33.     struct Catalog* thecatalog;
  34.     static unsigned counter;    // counter of opened objects
  35. //    static struct LocaleBase* LocaleBase; // we do not bother if other
  36.                       // opened the library before
  37. };
  38. #endif    // CATALOGF_H
  39.